<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>02-文档对象</title>
    <script>
        window.onload=function () {
            // 获取 body 元素
            let body = document.body;
            console.log(body);
            // 获取所有的超链接标签
            let links = document.links;
            console.log(links);
            // 获取所有的图片标签
            let imageArr = document.images;
            console.log(imageArr);
            console.log(imageArr[0]);
            // 获取所有的表单标签
            let formsArr = document.forms;
            console.log(formsArr);
            console.log(formsArr[0]);
            // 快速获取表单
            let frm2 = document.frm2;
            console.log(frm2);
            // 快速获取表单中的 input 标签
            let address = document.frm2.address;
            console.log(address);
            // 获取所有标签
            let all = document.all;
            console.log(all);
        }
    </script>
</head>
<body>
<div>我是div1</div>
<div>我是div2</div>
<div>我是div3</div>
<form action="#" name="frm1">
    用户名：<input type="text" name="username">
</form>
<form action="#" name="frm2">
    地址：<input type="text" name="address">
</form>
<img src="../images/1.gif" alt=""><img src="../images/2.gif" alt=""><img src="../images/静态表情包4.jpg" alt="">
<a href="#"></a><a href="#"></a><a href="#"></a>
</body>
</html>